<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<DecisionMaking.BusinessLogic.Model.AgentsModel>" MasterPageFile="~/Views/Shared/Site.Master" %>
<%@ Import Namespace="DecisionMaking.Domain" %>
<%@ Import Namespace="DecisionMaking.WebApp" %>
<%@ Import Namespace="MvcContrib.UI.Grid" %>
<%@ Import Namespace="MvcContrib.UI.MenuBuilder" %>

<asp:Content ContentPlaceHolderID="TitleContent" runat="server">Manage Agents</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MenuContent" runat="server">
    <% Html.Menu(Navigation.MainMenu(Url, Model.EnvironmentId)); %>
</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">

	<% Html.Grid<Agent>("agents").Columns( column => {
		column.For(c => c.Id);
        column.For(c => c.PctOfCuesKnown).Named("% Cues Known");
        column.For(c => c.CandidatesRecognized.Count).Named("Candidates Recognized");
	})
    .Empty("No agents found")
	.Render();%>
	
    <%= Html.ValidationSummary("Agent generation was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm("Generate", "Agents")) { %>
        <fieldset>
            <legend>Generate Agents</legend>
        	<%= Html.HiddenFor(m => m.EnvironmentId) %>
            <p class="field-multi-line field-textbox">
                <%= Html.LabelFor(m => m.Amount) %>
                <%= Html.TextBoxFor(m => m.Amount) %>
                <%= Html.ValidationMessageFor(m => m.Amount) %>
            </p>
            <p>
                <input type="submit" value="Generate" />
            </p>            
        </fieldset>
    <% } %>    	
	<p>
		<%= Html.ActionLink("Finish", "Index", "Environments")%>
	</p>
</asp:Content>